<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">

    <title>销售结算管理系统</title>
    <meta name="keywords" content="H+后台主题,后台bootstrap框架,会员中心主题,后台HTML,响应式后台">
    <meta name="description" content="H+是一个完全响应式，基于Bootstrap3最新版本开发的扁平化主题，她采用了主流的左右两栏式布局，使用了Html5+CSS3等现代技术">
    <link href="/hplus/css/bootstrap.min.css" rel="stylesheet">
    <link href="/hplus/css/font-awesome.min.css?v=4.4.0" rel="stylesheet">
    <link href="/hplus/css/animate.min.css" rel="stylesheet">
    <link href="/hplus/css/style.min.css" rel="stylesheet">
    <link href="/hplus/css/login.min.css" rel="stylesheet">
    <link href="/layer/2.4/css/layui.css" rel="stylesheet" type="text/css" />
    <!--[if lt IE 8]>
    <meta http-equiv="refresh" content="0;ie.html" />
    <![endif]-->
    <script>
        if(window.top!==window.self){window.top.location=window.location};
    </script>

</head>

<body class="signin">
    <div class="signinpanel">
        <div class="row">
            <div class="col-sm-7">
                <div class="signin-info">
<!--                     <div class="logopanel m-b"> -->
<!--                         <h1>[ 销售 结算 ]</h1> -->
<!--                     </div> -->
                    <div class="m-b"></div>
                    <h4>欢迎使用 <strong>销售结算管理系统</strong></h4>
                    <ul class="m-b">
                        <li><i class="fa fa-arrow-circle-o-right m-r-xs"></i> 优势一</li>
                        <li><i class="fa fa-arrow-circle-o-right m-r-xs"></i> 优势二</li>
                        <li><i class="fa fa-arrow-circle-o-right m-r-xs"></i> 优势三</li>
                        <li><i class="fa fa-arrow-circle-o-right m-r-xs"></i> 优势四</li>
                        <li><i class="fa fa-arrow-circle-o-right m-r-xs"></i> 优势五</li>
                    </ul>
<!--                     <strong>还没有账号？ <a href="#">立即注册&raquo;</a></strong> -->
                </div>
            </div>
            <div class="col-sm-5">
                <form method="post" id="loginForm">
                    <h4 class="no-margins">销售结算管理系统</h4>
                    <input type="text" class="form-control uname" id="username" name="username" placeholder="用户名" />
                    <input type="password" class="form-control pword m-b" id="password" name="password" placeholder="密码" />
                    <button class="btn btn-success btn-block">登录</button>
                </form>
            </div>
        </div>
    </div>
    <script src="/hplus/js/jquery.min.js?v=2.1.4"></script>
    <script src="/hplus/js/bootstrap.min.js?v=3.3.5"></script>
    <script src="/hplus/js/plugins/validate/jquery.validate.min.js"></script>
    <script src="/hplus/js/plugins/validate/messages_zh.min.js"></script>
    <script src="/hplus/js/demo/form-validate-demo.min.js"></script>
    <script type="text/javascript" src="/layer/2.4/layer.js"></script>
	<script type="text/javascript" src="/layer/2.4/layui.all.js"></script>
	<script type="text/javascript">
	$(function(){
		var captchaType = '[[${captchaType}]]';
		$("#loginForm").validate({
			rules:{
				username:{
					required:true,
					minlength:2,
					maxlength:16
				},
				password:{
					required:true
				}
				
			},
			messages:{
				username:{
					required:'帐号不能为空',
					minlength: "帐号长度不能小于2位",
					maxlength: "帐号长度不能大于16位"
				},
				password:{
					required:'密码不能为空'
				}
			},
			onkeyup:false,
			focusCleanup:true,
			success:"valid",
			submitHandler:function(form){
				var username=$('#username').val();;
	    		var password=$('#password').val();;
	    		var index = layer.load(0); //0代表加载的风格，支持0-2
				$.ajax({
		            url:'/login',
		            type:'post',
		            async:true,
		            data:{
		            	username:username,
		            	password:password
		            },
		            dataType: "json",
		            success: function(data){
		          		  layer.close(index);
		            	if (data.code ==0) {
			            	var url="/index";
			            	window.location.href = url;
		            	} else {
							layer.msg(data.msg);
		            	}
	               } 
	     	   }); 
				return false;
	       }, 
	       invalidHandler: function(form, validator) {  //不通过回调 
	    		 return false; 
	       } 
		});
	});
	</script>
</body>
</html>